<?php

namespace App\Service\Dao;

use App\ENUM\ENUM_IS_SHOW;
use App\Model\User;


class UserDao
{
    /**
     * Notes:获取用户信息
     * User: xsz
     * Date: 2024/5/16 15:10
     * @return array|\Hyperf\Database\Model\Builder|\Hyperf\Database\Model\Model|object
     */
    public function getUserFirst($where)
    {
        $user = User::where($where)->first();

        if (!empty($user)) {
            return $user;
        }
        return [];
    }

    /**
     * Notes:修改用户信息
     * User: xsz
     * Date: 2024/5/16 15:10
     * @return int
     */
    public function updateUser($where,$data)
    {
        return User::where($where)->update($data);
    }

    /**
     * Notes:添加用户
     * User: xsz
     * Date: 2024/5/16 16:20
     * @return bool
     */
    public function insert($data)
    {
        return User::insert($data);
    }
}